Skip to content
This repository was archived by the owner on Jan 23, 2021. It is now read-only.

Support to verify Webhook signatures #5

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

willock-stripe
Copy link

@willock-stripe willock-stripe commented May 9, 2019

Not sure if this as a genuinely useful feature given this is a tool for debugging, but, I dogfooded https://stripe.com/docs/webhooks/signatures to add signature verification.

Changes

  • Add signingSecret configuration to config.sample.js
  • Add verification path to Webhooks express server to verify signatures
  • Add documentation for signingSecret
  • Update some outdated, vulnerable dependencies (not, there are still some vulnerable packages which have breaking changes, so didn't get fixed by npm audit fix)

@willock-stripe
Copy link
Author

@mg-stripe – would you be able to take a glance at this at your leisure, please? 🙏

@nati-stripe
Copy link
Contributor

re pinging @mg-stripe , would love to see this included!

Copy link
Collaborator

@mg-stripe mg-stripe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the delay on this! A few quick changes and we can merge this.

@mg-stripe
Copy link
Collaborator

mg-stripe commented Jun 28, 2019

The more I think about this PR: an alternative approach would be to create the webhook whenever the app starts up and retrieve the webhook signing secret that way. (We'd want to delete and recreate the endpoint every time the app starts up to retrieve the signing secret, since it's only issued at creation time.)

Is the explicit Dashboard flow the easiest for users, or should we simply do this programmatically and implicitly?

@willock-stripe
Copy link
Author

Hi @mg-stripe – thank you so much for the feedback.

I think the application is significantly more user-friendly in a world where it provisions the Stripe webhook endpoint on the user's behalf. I've left in the ability to eschew the necessity to use ngrok and provide your own signing secret, too.

I do have a little FUD on whether removing the endpoint on SIGINT teardown is enough, or if it should be more aggressive by covering more exit codes?

Let me know what you think!

- Add `signingSecret` configuration to `config.sample.js`
- Add verification path to Webhooks express server to verify
  signatures
- Add documentation for `signingSecret`
- Update some outdated, vulnerable dependencies
@willock-stripe willock-stripe force-pushed the willock-verify-webhook-signatures branch from f7b993f to abc0459 Compare July 30, 2019 15:19
@CLAassistant
Copy link

CLAassistant commented Aug 6, 2020

CLA assistant check
All committers have signed the CLA.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants